home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr47 / qfml10.zip / QFML.INC < prev    next >
Text File  |  1995-01-26  |  5KB  |  165 lines

  1. ; QFM (Quick Flat Memory) Manajer
  2. ; (C)opyright 1995 by Render of ACC TEAM
  3.  
  4. ;/* ==================================================
  5. ; Start 32-bit plane mode
  6. ; Parameters: None
  7. ; Returns: 0 if success
  8. ;          1 ERROR getting himmem address
  9. ;          2 ERROR enabling A20
  10. ;          3 ERROR CPU already under prottected mode
  11. ;          4 ERROR CPU running under DPMI, cannot intialize.
  12. ;===================================================== */
  13. Extrn StartPL :far
  14.  
  15.  
  16.  
  17. ;/* ==================================================
  18. ; Leave 32-bit plane mode
  19. ; Parameters: None
  20. ; Returns: 0 if success
  21. ;    1 ERROR Himem was used to start plane mode
  22. ;      but it can not be found now.
  23. ;    2 ERROR Himem was used to start plane mode
  24. ;      but cannot find it's address now.
  25. ;    3 ERROR Trying to disable a20
  26. ;===================================================== */
  27. Extrn LeavePL :far
  28.  
  29.  
  30.  
  31. ;/* ==================================================
  32. ; Open all memory available past the first Mg
  33. ; Parameters: None
  34. ; Returns: 0 if success
  35. ;    1 ERROR Getting max. block size
  36. ;    2 ERROR Getting max. block.
  37. ;    3 ERROR Locking max. block to get its address
  38. ;===================================================== */
  39. Extrn OpenMem :far
  40.  
  41.  
  42.  
  43. ;/* ==================================================
  44. ; Close all memory reserved by OpenMem
  45. ; Parameters: None
  46. ; Returns: 0 if success
  47. ;    1 ERROR Trying to unlock block of memory.
  48. ;    2 ERROR Deallocking block of memory.
  49. ;===================================================== */
  50. Extrn CloseMem :far
  51.  
  52.  
  53.  
  54. ;/* ==================================================
  55. ; Moves blocks of memory in plane mode. Size can be
  56. ; anything from 0 bytes to 2^32 bytes.
  57.  
  58. ; Parameters: 1º Source offset. A 32 bit offset
  59. ;    pointing to the block of memory
  60. ;    defining source.
  61. ;       2º Destination offset. A 32 bit
  62. ;    offset pointing to the block
  63. ;    of memory to be used as destination.
  64. ;       3º Number of bytes to be moved.
  65. ;    A 32-bit number ranging from 0 to 2^32.
  66. ;
  67. ; Returns: A long integer representing a 32-bit offset
  68. ;    which is the last address used as destination+1.
  69. ;===================================================== */
  70. Extrn Pl2Pl :far
  71.  
  72.  
  73.  
  74. ;/* =====================================================================
  75. ; Moves blocks of memory in plane mode. Size can be
  76. ; anything from 0 bytes to 2^32 bytes. This one is
  77. ; for asm coding (parameters passed by registers).
  78.  
  79. ; Parameters: ESI a 32-bit pointer offset pointing the source.
  80. ;       EDI a 32-bit pointer offset pointing the destination.
  81. ;       EBX a 32-bit integer containing the number of bytes to move
  82.  
  83. ; Returns: EDI Last destination used + 1.
  84. ;======================================================================== */
  85.  
  86. Extrn Pl2Pla :far
  87.  
  88.  
  89.  
  90. ;/* ==================================================
  91. ; Translates a memory address in the form of seg:off
  92. ; to an offset of 32 bits.
  93.  
  94. ; Parameters: 1º SEGMENT
  95. ;       2º OFFSET
  96.  
  97. ; Returns: OFFSET as a 32-bit number.
  98. ;===================================================== */
  99. Extrn VirToPL :far
  100.  
  101.  
  102.  
  103. ;/* ==================================================
  104. ; Translates a memory address in the form of seg:off
  105. ; to an offset of 32 bits. This one is for asm coders.
  106. ; Parameters passed by registers.
  107.  
  108. ; Parameters: AX=SEGMENT
  109. ;       BX=OFFSET
  110.  
  111. ; Returns: EAX= OFFSET as a 32-bit number.
  112. ;===================================================== */
  113.  
  114. Extrn VirToPLa :far
  115.  
  116.  
  117.  
  118. ;/* ==================================================
  119. ; Gives the start address of the memory block reserved
  120. ; by OpenMem.
  121.  
  122. ; Parameters: None
  123. ; Returns: OFFSET to the start of the memory block allocated
  124. ;    by OpenMem.
  125. ;===================================================== */
  126. Extrn GiveSta :far
  127.  
  128.  
  129.  
  130. ;/* ==================================================
  131. ; Get the amount of memory reserved by OpenMem()
  132. ; Parameters: None
  133. ; Returns: Number of Kilobytes allocated by OpenMem.
  134. ;===================================================== */
  135. Extrn GiveAmo :far
  136.  
  137.  
  138.  
  139. ;/* ==================================================
  140. ; These are the usual poke functions, ranging from
  141. ; byte to dword.
  142.  
  143. ; Parameters: 1º OFFSET of memory to poke
  144. ;       2º DATA to poke.
  145.  
  146. ; Returns: DATA poked.
  147. ;===================================================== */
  148. Extrn Pokeb     :far
  149. Extrn Pokew     :far
  150. Extrn Pokedw    :far
  151.  
  152.  
  153.  
  154. ;/* ==================================================
  155. ; These are the usual peek functions, ranging from
  156. ; byte to dword.
  157.  
  158. ; Parameters: 1º OFFSET of memory to poke
  159.  
  160. ; Returns: DATA peeked.
  161. ;===================================================== */
  162. Extrn Peekb     :far
  163. Extrn Peekw     :far
  164. Extrn Peekdw    :far
  165.